package controle.redeNeural;

import org.neuroph.core.NeuralNetwork;
import org.neuroph.core.learning.TrainingSet;
import org.neuroph.nnet.MultiLayerPerceptron;
import org.neuroph.nnet.learning.DynamicBackPropagation;

import Matematica.XY;

import interfaces.IParametroRedeNeural;
import interfaces.IRN;

public class RNGenerica implements IRN {
	
	protected NeuralNetwork perceptron;
	protected IParametroRedeNeural ultimaEntrada;
	
	/**
	 * Conjunto de treinamento com 5 campos de entrada (vide problema) e 2
	 * campos de saida
	 * 
	 * Times de 3 jogadores e um refém cada implicam em 8 entradas
	 * 
	 */
	TrainingSet training;
	
	DynamicBackPropagation learning;

	
	public RNGenerica(String caminhoRedeNeuralCarregar, int numeroEntradas, int numeroSaidas){
	   perceptron = MultiLayerPerceptron.load(caminhoRedeNeuralCarregar);
	   //instancia o algoritmo de aprendizado
	   learning = new DynamicBackPropagation();
	   learning.setMaxIterations(10);
	   learning.setLearningRate(0.7);
	   training = new TrainingSet(numeroEntradas, numeroSaidas);
	}

	public XY [] executar(IParametroRedeNeural parametroRedeNeural) {
		perceptron.setInput();
		perceptron.calculate();
		perceptron.getOutput();
		return null;
	}

	public void treinarNovamente() {
	}
}
